import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

public class J2411051 {
    public static void main(String[] args) {
        System.out.println("input:");
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        if(isPalindrome(str)){
            System.out.println("是回文");
        }else {
            System.out.println("不是回文");
        }
    }
    public static boolean isLegal(char ch) {
        if (ch <= 'z' && ch >= 'a' || ch >= '1' && ch <= '9') {
            return true;
        }
        return false;
    }
    public static boolean isPalindrome(String s) {
        s = s.toLowerCase();
        int left = 0;
        int right = s.length() - 1;
        while (left < right) {
            while (left < right && !isLegal(s.charAt(left))) {
                left++;
            }
            while (left < right && !isLegal(s.charAt(right))) {
                right--;
            }
            if (s.charAt(left) != s.charAt(right)) {
                return false;
            } else {
                right--;
                left++;

            }
        }
        return true;
    }
}

